#include"comm.hpp"
int main()
{
    //1、打开命名管道
    int fd=open(ipcPath.c_str(),O_WRONLY);
    if(fd<0)
    {
        perror("open");
        exit(1);
    }

    char buffer[1024];
    while(true)
    {
        buffer[0]=0;
        cout<<"please enter message->"<<endl;
        fflush(stdout);
        ssize_t s=read(0,buffer,sizeof(buffer)-1);
        if(s>0)
        {
            buffer[s]=0;
            write(fd,buffer,strlen(buffer));
        }
        else if(s<=0)
        {
            exit(1);
        }
    }
    close(fd);
    return 0;
}